/**
 * 
 */
package com.store;

import java.sql.Date;

import com.jedi.BaseObj;
import com.tss.util.DbConn;

/**
 * @author wevjoso
 * 
 */
public class Palmonth extends BaseObj {
	
	
	public void update() {
		clearErr();
		DbConn conn = new DbConn();

		try {
			conn.setAutoCommit(false);
			String sql = "update palmonth  set cfee=?,tfee=?,hfee=?,pfee=?, wfee=?,createman=? where y=? and m=? ";
			conn.prepare(sql);
			conn.setDouble(1, getCfee());
			conn.setDouble(2, getTfee());
			conn.setDouble(3, getHfee());
			conn.setDouble(4, getPfee());
			conn.setDouble(5, getWfee());
			conn.setString(6, getCreateman());
		
		
			conn.setInt(7, getY());
			conn.setInt(8, getM());
			conn.executeUpdate();
			conn.commit();
		} catch (Exception ex) {
			ex.printStackTrace();
			setErr(ex.getMessage());

		} finally {
			conn.close();
		}
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
///////////////////////////////////////////////////////////////////////
	public Palmonth(){}
	public Palmonth(String id){
		
		
		this.id=id;
	}
	String id="";//
	private int y = 0;// int4 NOT NULL DEFAULT date_part('year'::text,//
						// ('now'::text)::date), -- 年

	private int m = 0;// int2 NOT NULL DEFAULT date_part('month'::text,//
						// ('now'::text)::date), -- 月

	private double cfee = 0.00;// numeric(12,2) DEFAULT 7500, -- （手机额度+坐机额度）*人数

	private double tfee = 0.00;// numeric(12,2) DEFAULT 10000, -- 市内交通费+招待费

	private double hfee = 0.00;// numeric(12,2) DEFAULT 90000, --
								// 人力资源费（月工资总和*1.3）

	private double pfee = 0.00;// numeric(12,2) DEFAULT 2500, --
								// (实际使用笔记本数量*250)

	private double wfee = 0.00;// numeric(12,2) DEFAULT 6200, -- 工位分摊+其他
								// （23000*3）/12

	private Date createtime = null;// timestamp DEFAULT now(), -- 创建时间

	private String createman = "";// varchar(20), -- 创建人

	public double getCfee() {
		return cfee;
	}

	public void setCfee(double cfee) {
		this.cfee = cfee;
	}

	public String getCreateman() {
		return createman;
	}

	public void setCreateman(String createman) {
		this.createman = createman;
	}

	public Date getCreatetime() {
		return createtime;
	}

	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}

	public double getHfee() {
		return hfee;
	}

	public void setHfee(double hfee) {
		this.hfee = hfee;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public int getM() {
		return m;
	}

	public void setM(int m) {
		this.m = m;
	}

	public double getPfee() {
		return pfee;
	}

	public void setPfee(double pfee) {
		this.pfee = pfee;
	}

	public double getTfee() {
		return tfee;
	}

	public void setTfee(double tfee) {
		this.tfee = tfee;
	}

	public double getWfee() {
		return wfee;
	}

	public void setWfee(double wfee) {
		this.wfee = wfee;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

}
